<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试哦</title>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <style>
		body{
			padding: 20px;
		}
        .box{
            width: 500px;
            height: 300px;
            border: 2px solid #0cf;
            float: left;
			border-radius: 14px;
			overflow: auto;
        }
		.btnbox{
            width: 500px;
            height: 300px;
            border: 2px solid #0cf;
			border-radius: 14px;
			float: left;
			margin-right: 20px;
        }
        .put{
            border: none;
            background: #00ccff;
            color: #fff;
            font-size: 16px;
            width: 60px;
            height: 36px;
            display: block;
            margin: 20px auto;
			font-size: 18px;
			text-align: center;
			border-radius: 10px;
			outline: none;
        }
        .box p,.btnbox p{
            font-size: 18px;
            text-align: center;
            margin: 10px 0;
        }
        .box input,.btnbox input{
        	width: 160px;
        	height: 32px;
        	text-align: center;
        	border-radius: 6px;
        	display: block;
        	margin: auto;
        	border: none;
        	border: 2px solid #00CCFF;
        }
    </style>
</head>
<body>
    <div class="btnbox">
		<p>获取数量</p>
		<input type="number" id="num" min="10"/>
		<p>获取时间（分钟）</p>
		<input type="number" id="time" min="5"/>
		<button class="put">获取</button>
    </div>
	<div class="box" id="txt">
		<p>当前移动平均线的点（保留4位小数）</p>
		<input type="text" readonly id="now">
		<p>5小时前移动平均线（保留4位小数）</p>
		<input type="text" readonly id="before">
	</div>
<script>
    $('.put').click(function () {
		var time=$('#time').val();
		var num=Number($('#num').val());

        $.ajax({
            type: 'get',
            url: 'http://localhost:3000',
			data:{
				code:'g6',
				num:num,
				time:time+'min'
			},
            success: function (data) {
				console.log(data)
               $('#now').val(data.now);
               $('#before').val(data.before);
            },
            error: function (err) {
                console.log(err)
            }
        })
    })
</script>
<script type="text/javascript">
var data=[];



</script>
</body>
</html>